package cn.cloudplug.instar_ec.main.fingerprint;

import android.os.Bundle;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;

import butterknife.BindView;
import butterknife.OnClick;
import cn.cloudplug.core.index.Scent;
import cn.cloudplug.instar_ec.R;
import cn.cloudplug.instar_ec.R2;
import cn.cloudplug.instar_ec.main.base.BackDelegate;

/**
 * Created by pc on 2018/2/7.
 */

public class CreateFingerprintDelegate extends BackDelegate {
    @BindView(R2.id.btn_positive)
    AppCompatButton btn_positive;

    @BindView(R2.id.tv_hint)
    AppCompatTextView tv_hint;

    @BindView(R2.id.iv_light)
    AppCompatImageView iv_light;

    @OnClick(R2.id.btn_positive)
    void onFinish(){
        getSupportDelegate().pop();
    }

    @Override
    protected Object setContent() {
        return R.layout.delegate_input_fingerprint;
    }

    @Override
    protected void onBindView(Bundle savedInstanceState, View view) {
        setTitle("新建指纹");
        //test
        status_new();
        Scent.mianHandler().postDelayed(new Runnable() {
            @Override
            public void run() {
                status_finish();
            }
        },2000);
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onHiddenChanged(boolean hidden) {
        super.onHiddenChanged(hidden);
    }

    @Override
    public void onSupportVisible() {
        super.onSupportVisible();
    }

    private void status_finish() {
        btn_positive.setVisibility(View.VISIBLE);
        iv_light.setVisibility(View.VISIBLE);
        tv_hint.setText("录入成功");

    }

    private void status_new() {
        btn_positive.setVisibility(View.GONE);
        iv_light.setVisibility(View.GONE);
        tv_hint.setText("请录入指纹");
    }
}
